package ge.engine;


import java.util.ArrayList;

public class Level extends Actor
{
	protected ArrayList<Actor> actores;
	protected Mechanic mechanic;
	/**
	 * 	The constructor initializes the features of Level.
	 * 	The level has associated an IOEventModule
	 */
	public Level()
	{
		actores = new ArrayList<Actor>();
		mechanic = new Mechanic();
	}

	/**
	 * 	That function is called just before the level is loaded
	 */
	public void load()
	{
		
	}
	
	/**
	 * 	That function is called just before new level will be loaded
	 */
	public void unload()
	{
		
	}

	/**
	 * Updates the mechanic and all its components
	 */
	@Override
	public void update() 
	{
		mechanic.update(); //Player interaction supposed to be.
		super.update();
	}
	/**
	 * 	
	 * @return Actual mechanic of the level
	 */
	public Mechanic getMechanic()
	{
		return mechanic;
	}
	/**
	 * 	Sets the new Mechanic, load of that new and unload of the old is called.
	 * @param newMechanic New Mechanic
	 */
	public void setMechanic(Mechanic newMechanic)
	{
		mechanic.unload();
		mechanic= newMechanic;
		mechanic.load();
	}
	
	
	 
	
}
